﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace myStuff
{
    public partial class ResizeForm : Form
    {
        public int scale = 75;
        public ResizeForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (int.TryParse(textBox1.Text, out scale))
            {
                if (scale > 0 && scale < 1000)
                {
                    this.DialogResult = DialogResult.OK;
                    Close();
                    return;
                }
            }
            MessageBox.Show("bad number");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)
                button1_Click(null, EventArgs.Empty);
        }
    }
}
